
package com.insigma.business.qrcode.common.converter;


import com.insigma.business.qrcode.welfare.dto.MarketingSpotBSearcher;
import com.insigma.business.qrcode.welfare.dto.MarketingSpotDTO;
import com.insigma.business.qrcode.welfare.dto.request.MarketingSpotSearchRequest;
import com.insigma.business.qrcode.welfare.entity.MarketingSpotDO;
import org.springframework.beans.BeanUtils;

import java.util.List;


public class MarketingSpotProviderConverter extends AbstractConverter<MarketingSpotDTO, MarketingSpotDO> {

    private final static MarketingSpotProviderConverter marketingSpotConverter = new MarketingSpotProviderConverter();

    private MarketingSpotProviderConverter(){}


    public static MarketingSpotBSearcher convertRequestSO2Searcher(final MarketingSpotSearchRequest request){
        final MarketingSpotBSearcher marketingSpotBSearcher = new MarketingSpotBSearcher(request.getPageNo(),
        request.getPageSize(),request.getSortKeyValueJoint());
        BeanUtils.copyProperties(request,marketingSpotBSearcher);
        return marketingSpotBSearcher;
    }

    public static MarketingSpotDTO convertResponseDO2DTO(final MarketingSpotDO marketingSpotDO){
        return marketingSpotConverter.convertGenericResponseDO2DTO(marketingSpotDO);
    }
    public static List<MarketingSpotDTO> convertResponseDOList2DTOList(final List<MarketingSpotDO> marketingSpotDOList){
        return marketingSpotConverter.convertGenericResponseDOList2DTOList(marketingSpotDOList);
    }

    @Override
    protected MarketingSpotDTO doConvertResponseDO2DTO(MarketingSpotDO marketingSpotDO) {
        return null;
    }

//    public static MarketingSpotDO convertRequestUO2DO(final MarketingSpotUpdateRequest marketingSpotUpdateRequest) {
//        final MarketingSpotDO marketingSpotDO = new MarketingSpotDO();
//        BeanUtils.copyProperties(marketingSpotUpdateRequest,marketingSpotDO);
//
//        return marketingSpotDO;
//    }

    
//    public static MarketingSpotDO convertRequestIO2DO(final MarketingSpotInsertRequest marketingSpotInsertRequest) {
//        final MarketingSpotDO marketingSpotDO = new MarketingSpotDO();
//        BeanUtils.copyProperties(marketingSpotInsertRequest,marketingSpotDO);
//        return marketingSpotDO;
//    }
//
//
//    public static List<MarketingSpotDTO> convertResponseDOList2DTOList(final List<MarketingSpotDO> marketingSpotDOList){
//        return marketingSpotConverter.convertGenericResponseDOList2DTOList(marketingSpotDOList);
//    }
//
//
//    public static MarketingSpotDTO convertResponseDO2DTO(final MarketingSpotDO marketingSpotDO){
//        return marketingSpotConverter.convertGenericResponseDO2DTO(marketingSpotDO);
//    }

    
//    protected MarketingSpotDTO doConvertResponseDO2DTO(MarketingSpotDO marketingSpotDO) {
//        final MarketingSpotDTO marketingSpotDTO = new MarketingSpotDTO();
//        try {
//            BeanUtils.copyProperties(marketingSpotDO, marketingSpotDTO);
//        }catch(RuntimeException be){
//
//            return null;
//        }
//        return marketingSpotDTO;
//    }

}
